*** Use with dataset "PSRM_Dataset_Grapevine Effect ***


* Set working directory
* cd "SET WORKING DIRECTORY HERE"
use "PSRM_Dataset_Grapevine Effect.dta", clear
 
*** TABLE 1 ***

bysort country: tab target_zone if wave==1

bysort country: tab target_zone if wave==2


*** TABLE 2 ***

egen violence=rmean(vio_alq vio_rel vio_eff vio_islam)

areg violence date_wave1 if wave==1, absorb(target_zone) cluster(target_zone) 

areg violence date_wave2 if wave==2, absorb(target_zone) cluster(target_zone)


*** TABLE 3 ***

replace employed=0 if employed==2

replace a4=. if a4==88
replace a4=. if a4==99
replace a4=0 if a4==2

areg violence date_wave1 itemsum education employed if wave==1, absorb(target_zone) cluster(target_zone) 

areg violence date_wave2 itemsum education a4 if wave==2, absorb(target_zone) cluster(target_zone)


*** TABLE 4 ***

areg endorse1_expd i.endorse1_dummy##c.date_wave1 if wave==1, absorb(target_zone) cluster(target_zone)

areg endorse1_expd i.endorse1_dummy##c.date_wave1 itemsum education employed if wave==1, absorb(target_zone) cluster(target_zone)

areg endorse1_expbd i.endorse1_dummyb##c.date_wave2 if wave==2, absorb(target_zone) cluster(target_zone)

areg endorse1_expbd i.endorse1_dummyb##c.date_wave2 itemsum education a4 if wave==2, absorb(target_zone) cluster(target_zone)


*** TABLE A2a ***

areg vio_alq date_wave1 if wave==1, absorb(target_zone) cluster(target_zone) 

areg vio_islam date_wave1 if wave==1, absorb(target_zone) cluster(target_zone) 

areg vio_eff date_wave1 if wave==1, absorb(target_zone) cluster(target_zone) 

areg vio_rel date_wave1 if wave==1, absorb(target_zone) cluster(target_zone) 


*** TABLE A2b ***

areg vio_alq date_wave2 if wave==2, absorb(target_zone) cluster(target_zone)

areg vio_islam date_wave2 if wave==2, absorb(target_zone) cluster(target_zone)

areg vio_eff date_wave2 if wave==2, absorb(target_zone) cluster(target_zone)

areg vio_rel date_wave2 if wave==2, absorb(target_zone) cluster(target_zone)


*** TABLE A3 ***

logit endorse1_expd i.endorse1_dummy##c.date_wave1 itemsum education employed i.target_zone if wave==1, cluster(target_zone)

logit endorse1_expbd i.endorse1_dummyb##c.date_wave2 itemsum education a4 i.target_zone if wave==2, cluster(target_zone)


*** TABLE A4a ***

egen cluster02 = group(samplepoint)

set matsize 10000

areg violence date_wave1 i.target_zone if wave==1, absorb(cluster02) cluster(cluster02)

areg violence date_wave2 i.target_zone if wave==2, absorb(ename) cluster(ename)


*** TABLE A4b ***

egen cluster01 = group(samplepoint)

areg endorse1_expd i.endorse1_dummy##c.date_wave1 i.target_zone if wave==1, absorb(cluster01) cluster(cluster01)

areg endorse1_expbd i.endorse1_dummyb##c.date_wave2 i.target_zone if wave==2, absorb(ename) cluster(ename)


*** TABLE A7a ***

areg violence date_wave1 i.target_zone if wave==1, absorb(days_wave1) cluster(target_zone) 

areg violence date_wave2 i.target_zone if wave==2, absorb(days_wave2) cluster(target_zone)


*** TABLE A7b ***

areg endorse1_expd i.endorse1_dummy##c.date_wave1 i.target_zone if wave==1, absorb(days_wave1) cluster(target_zone)

areg endorse1_expbd i.endorse1_dummyb##c.date_wave2 i.target_zone if wave==2, absorb(days_wave2) cluster(target_zone)


*** TABLE A8a ***

areg violence date_wave2 interviewer if wave==2, absorb(target_zone) cluster(target_zone)


*** TABLE A8b ***

areg endorse1_expbd i.endorse1_dummyb##c.date_wave2 i.endorse1_dummyb##c.interviewer if wave==2, absorb(target_zone) cluster(target_zone)


*** TABLE A9a ***

areg violence date_wave2 interviewer i.target_zone if wave==2, absorb(days_wave2) cluster(target_zone)


*** TABLE A9b ***

areg endorse1_expbd i.endorse1_dummyb##c.date_wave2 i.endorse1_dummyb##c.interviewer i.target_zone if wave==2, absorb(days_wave2) cluster(target_zone)
